package com.firstpro.domain;

import com.firstpro.domain.BaseDomain;

import javax.persistence.*;
import java.sql.Date;

/**
 * Created by Administrator on 2017/5/13.
 */
@Entity
@Table(name = "loginlog", schema = "firstprozhl", catalog = "")
public class LoginlogEntity extends BaseDomain {
    private int loginlogLogid;
    private String ip;
    private Date loginDate;
    private String user;

    @Id
    @Column(name = "loginlog_logid")
    public int getLoginlogLogid() {
        return loginlogLogid;
    }

    public void setLoginlogLogid(int loginlogLogid) {
        this.loginlogLogid = loginlogLogid;
    }

    @Basic
    @Column(name = "ip")
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "login_date")
    public Date getLoginDate() {
        return loginDate;
    }

    public void setLoginDate(Date loginDate) {
        this.loginDate = loginDate;
    }

    @Basic
    @Column(name = "user")
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LoginlogEntity that = (LoginlogEntity) o;

        if (loginlogLogid != that.loginlogLogid) return false;
        if (ip != null ? !ip.equals(that.ip) : that.ip != null) return false;
        if (loginDate != null ? !loginDate.equals(that.loginDate) : that.loginDate != null) return false;
        if (user != null ? !user.equals(that.user) : that.user != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = loginlogLogid;
        result = 31 * result + (ip != null ? ip.hashCode() : 0);
        result = 31 * result + (loginDate != null ? loginDate.hashCode() : 0);
        result = 31 * result + (user != null ? user.hashCode() : 0);
        return result;
    }
}
